package com.efuture.androidmvvmdemo.base

import android.app.Application
import android.content.pm.ApplicationInfo
import com.efuture.netrequestdemo.utils.AppGlobal

/**

 *@description:TODO
 * @author: zhaoshanshan
 * @date: 2022/3/24 7:04 下午

 */
class MyApplication:Application() {
    companion object {
        // app实例
        lateinit var instance: MyApplication

    }

    override fun onCreate() {
        super.onCreate()
        instance = this
        initDebug()
    }
    /**
     * 获取是否debug版本
     */
    private fun initDebug() {
        AppGlobal.isDebugMode = instance.applicationInfo != null && instance.applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE != 0
    }
}